# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Baptiste Jonglez <baptiste--aur at jonglez dot org>

pkgname=remake
_remakever=dbg-1.6
pkgver=4.3+${_remakever/-/}
pkgrel=2
pkgdesc="Enhanced GNU Make - tracing, error reporting, debugging, profiling and more"
arch=('loong64' 'x86_64')
url="http://bashdb.sourceforge.net/remake/"
license=('GPL3')
depends=('glibc' 'guile')
_archive="$pkgname-${pkgver%+*}+$_remakever"
source=("https://sourceforge.net/projects/bashdb/files/remake/4.3%2B${_remakever}/$_archive.tar.gz")
sha256sums=('f6a0c6179cd92524ad5dd04787477c0cd45afb5822d977be93d083b810647b87')

prepare() {
  cd "$_archive"
  autoreconf -fi
}

build() {
  cd "$_archive"
  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
  ./configure --prefix=/usr
  make
}

package() {
  cd "$_archive"
  make DESTDIR="${pkgdir}" install
  rm "$pkgdir"/usr/share/info/make.info{,-1,-2}
}
